<?php
require_once($_SESSION["root_path"]."/Query.inc");
 
function query_all_applicants() {
	$q = new Query("applicant");
	$q->where("applicant.selection_campaign_id=".$_SESSION["campaign_id"]);
	return $q;
}

function query_not_excluded_applicants() {
	$q = query_all_applicants();
	$q->where("applicant.excluded=0");
	return $q;
}

function query_programs() {
	$q = new Query("selection_campaign_programs");
	$q->join("program", null, array("program.program_id=selection_campaign_programs.program_id"));
	$q->where("selection_campaign_programs.selection_campaign_id=".$_SESSION["campaign_id"]);
	$q->order("program.program_id");
	return $q;
}

?>